<?php
include_once 'field.class.php';

class field_commend extends field
{
    protected $fieldname = '推荐到';
    function create_form($value='')
    {
        $pos = include APP_ROOT.'admin/include/position.inc.php';
        $form = form::checkbox($pos, 'data[commend]', 'commend', $value);
        $hidden = "<input type='hidden' name='data[commend][]' value='0'/>";
        return $hidden.$form;
    }

    function get_data($data)
    {
        if(is_array($data))
        {
            $data = ','.implode(',', $data).',';
        }
        else
        {
            $data = '';
        }
        return $data;
    }
    
    
    
}
?>